package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * 实现容易记事本
 */
public class Test {
    public static void main(String[] args) throws IOException {
        Scanner scanner=new Scanner(System.in);
        FileOutputStream fos=new FileOutputStream("note.txt");
        while (true){
            String str=scanner.next();
            if ("exit".equalsIgnoreCase(str)){//忽略大小写比较字符串内容
                break;
            }
            fos.write(str.getBytes(StandardCharsets.UTF_8));
        }
        fos.close();
    }
}
